/**
 * @(#)TestRoleServiceImpl.java 2009-11-16
 *   
 * Copyright  (c) 2009-2010 Wilmar IT Service,  Inc.   
 * All  rights  reserved.   
 * TODO
 */

package test.service.process;

import java.util.HashSet;
import java.util.Set;

import com.wilmar.process.core.services.spi.IRoleService;
import com.wilmar.process.entity.Role;
import com.wilmar.process.entity.User;
import com.wilmar.process.exception.DirtyDataException;

/**
 * @author makubex Email:makubexnet@gmail.com
 * @version 1.0.0
 */
public class SimpleRoleServiceImpl implements IRoleService {

	/** 
	 * @see
	 * com.wilmar.process.core.services.api.IRoleService#getDetailRoleByRoleCode
	 * (java.lang.String, java.lang.String)
	 */
	
	public Role getDetailRoleByRoleCode(String roleCode, String outerSystem) {
		Role role = null;
		try {
			role = new Role("wsp-role-ra");
		} catch (DirtyDataException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return role;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.wilmar.process.core.services.api.IRoleService#getListRolesByUser(
	 * com.wilmar.process.entity.User)
	 */
	
	public Set<Role> getListRolesByUser(User user) {
		Set<Role> roleSet = new HashSet<Role>();
		try {
			roleSet.add(new Role("wsp-role-ra"));
			roleSet.add(new Role("wsp-role-rb"));
			roleSet.add(new Role("wsp-role-rc"));
			roleSet.add(new Role("wsp-role-rd"));
		} catch (DirtyDataException e) {
			e.printStackTrace();
		}
		return roleSet;
	}

}
